/*修改按钮*/
let change=document.getElementsByClassName("change");
/*删除按钮*/
let deleteUser=document.getElementsByClassName("delete");
/*弹窗*/
let popupWindow=document.getElementsByClassName("popupWindow");
let userNameS=document.getElementsByClassName("userNameS");
/*点击删除*/
var allTd=document.getElementsByClassName("td");
for(let i=0;i<deleteUser.length;i++){
    /*点击修改或删除按钮弹出弹窗*/
        deleteUser[i].onclick=function(){
            mask.style.display="block";
            popupWindow[i].style.display="block";
            userNameS[i].innerHTML=allTd[i*10+1].innerHTML;
        }
}

function Tips(i){
    let tip=document.getElementsByClassName("tips")[0];
    tip.innerHTML=i;
    tip.style.top="56px";
    let timer=setTimeout(function(){
        tip.style.top="-56px";
        clearTimeout(timer);
    },1000);
}
/*取消按钮*/
let cancel=document.getElementsByClassName("cancel");
/*确定按钮*/
let determine=document.getElementsByClassName("determine");

/*点击确定或取消按钮弹窗消失*/
for(let i=0;i<cancel.length;i++){
    cancel[i].onclick=function(){
        mask.style.display="none";
        popupWindow[i].style.display="none";
    }
}
for(let i=0;i<determine.length;i++){
    determine[i].onclick=function(){
        mask.style.display="none";
        popupWindow[i].style.display="none";
    }
}
let popInput=document.getElementsByClassName("popInput");
for(let i=0;i<8;i++){
    popInput[i].onfocus=function(){
        popInput[i].style.border="1px solid #89c3eb";
    }
    popInput[i].onblur=function(){
        popInput[i].style.border="1px solid rgba(0,0,0,0.1)"
    }
}
let cut=document.getElementsByClassName("cut");
// let deleteBtn=document.getElementById("deleteBtn");
var mask=document.getElementsByClassName("mask")[0];
let pop=document.getElementsByClassName("pop");
let userNoBtn=document.getElementById("userNoBtn");
let userYesBtn=document.getElementById("userYesBtn");
let tbody=document.getElementsByClassName("tbody")[0];
let optionWomen=document.getElementsByClassName("optionWomen");
let optionMen=document.getElementsByClassName("optionMen");
let option =document.getElementById("option");
for(let i=0;i<change.length;i++){
    change[i].onclick=function(){
        mask.style.display="block";
        pop[i].style.display="block";
        //option[i].innerHTML=allTd[3+(i*10)].innerHTML;
        // if(allTd[3+(i*10)]=="男"){
        //     // optionMen[i].value=true;
        //     // optionWomen[i].value=false;
        //     // optionMen[i].style.selected="selected";
        //     // optionWomen[i].style.selected=" ";
        //     optionMen[i].setAttribute("selected", "selected");
        //     optionWomen[i].setAttribute(" "," ");
        // }else{
        //     // optionWomen[i].value=true;
        //     // optionMen[i].value=false;
        //     // optionWomen[i].style.selected="selected";
        //     // optionMen[i].style.selected=" ";
        //     optionWomen[i].setAttribute("selected", "selected");
        //     optionMen[i].setAttribute(" "," ");
        // }
        // // for(let j=0;j<allTd.length;j++){
        // //     option[j].value=allTd[3+(i*10)].innerHTML;
        // // }
    }
    cut[i].onclick=function(){
        mask.style.display="none";
        pop[i].style.display="none";
    }
    userNoBtn.onclick=function(){
        mask.style.display="none";
        pop[i].style.display="none";
    }
    userYesBtn.onclick=function(){
        mask.style.display="none";
        pop[i].style.display="none";
    }
}

let examine=document.getElementsByClassName("examine");
let examinePop=document.getElementsByClassName("examinePop");
let examineCut=document.getElementsByClassName("examineCut");
for(let i=0;i<examine.length;i++){
    examine[i].onclick=function(){
        mask.style.display="block";
        examinePop[i].style.display="block";
        // for(let j=0;j<allTd.length;j++){
        //     popInput[j].value=allTd[j].innerHTML;
        // }
    }
    examineCut[i].onclick=function(){
        mask.style.display="none";
        examinePop[i].style.display="none";
    }
}


// setTimeout(function(){
//     for(let i=0;i<allTd.length;i++){
//         for(let j=0;j<popInput.length;j++){
//             popInput[j].value=allTd[i].innerHTML;
//         }
//     }
// },1000);

// //取消监测调用下面的方法
// function unbindunload() {
//     window.onbeforeunload=null;//取消事件绑定
// }
// unbindunload();





